﻿namespace Admin.NET.Core;

/// <summary>
/// 客户档案表
/// </summary>
[SugarTable(null, "CRM客户")]
[SysTable]
[SugarIndex("index_{table}_C", nameof(CustName), OrderByType.Asc)]
public partial class CRMCustomer : EntityBase
{
    /// <summary>
    /// 客户名称
    /// </summary>
    [SugarColumn(ColumnDescription = "客户名称", Length = 64)]
    [MaxLength(64)]
    public string CustName { get; set; }

    /// <summary>
    /// 客户负责人
    /// </summary>
    [SugarColumn(ColumnDescription = "客户负责人")]
    public long CustLeadId { get; set; } = 0;


    /// <summary>
    /// 是否关注
    /// </summary>
    [SugarColumn(ColumnDescription = "是否关注")]
    public int IsCollect { get; set; } = 0;


    /// <summary>
    /// 客户来源，使用枚举类型来限制取值范围
    /// </summary>
    [SugarColumn(ColumnDescription = "客户来源")]
    public CustomerSource CustomerSource { get; set; }


    /// <summary>
    /// 首要联系人
    /// </summary>
    [SugarColumn(ColumnDescription = "首要联系人", Length = 32)]
    [MaxLength(32)]
    public string? ContactName { get; set; }


    /// <summary>
    /// 手机号码
    /// </summary>
    [SugarColumn(ColumnDescription = "手机号码", Length = 11)]
    [MaxLength(11)]
    public string MobilePhone { get; set; } = "";


    /// <summary>
    /// 电话号码
    /// </summary>
    [SugarColumn(ColumnDescription = "电话号码", Length = 11)]
    public string Telephone { get; set; } = "";


    /// <summary>
    /// 客户级别
    /// </summary>
    [SugarColumn(ColumnDescription = "客户级别")]
    public CustomerLevel CustomerLevel { get; set; }

    /// <summary>
    /// 客户状态
    /// </summary>
    /// 
    [SugarColumn(ColumnDescription = "客户状态")]
    public CustomerStatus CustomerStatus { get; set; }


    /// <summary>
    /// 客户规格
    /// </summary>
    [SugarColumn(ColumnDescription = "客户规格")]
    public CustomerSpecification CustomerSpecification { get; set; }


    /// <summary>
    /// 下次联系时间
    /// </summary>
    [SugarColumn(ColumnDescription = "下次联系时间")]
    public DateTime? NextContactDate { get; set; }


    /// <summary>
    /// 工作地址所在省
    /// </summary>
    [SugarColumn(ColumnDescription = "所在省")]
    public long? Province { get; set; }

    /// <summary>
    /// 工作地址所在市
    /// </summary>
    [SugarColumn(ColumnDescription = "所在市")]
    public long? City { get; set; }

    /// <summary>
    /// 工作地址所在区县
    /// </summary>
    [SugarColumn(ColumnDescription = "区县")]
    public long? District { get; set; }

    /// <summary>
    /// 详细地址
    /// </summary>
    /// 
    [SugarColumn(ColumnDescription = "详细地址", Length = 256)]
    [MaxLength(256)]
    public string DetailedAddress { get; set; } = "";


    /// <summary>
    /// 最后跟进记录
    /// </summary>
    /// 
    [SugarColumn(ColumnDescription = "最后跟进记录", Length = 512)]
    public string LastFollowUpRecord { get; set; } = "";


    /// <summary>
    /// 最后跟进时间
    /// </summary>
    /// 
    [SugarColumn(ColumnDescription = "最后跟进时间")]
    public DateTime? LastFollowUpTime { get; set; }


    /// <summary>
    /// 备注
    /// </summary>
    [SugarColumn(ColumnDescription = "备注", Length = 512)]
    [MaxLength(512)]
    public string? Remark { get; set; }


    /// <summary>
    /// 排序
    /// </summary>
    [SugarColumn(ColumnDescription = "排序")]
    public int OrderNo { get; set; } = 100;

}
